import { request } from "@/api";
import { API } from "@/api/modules/dwh/typings";

/** delete GET /tableInfo/delete */
export async function deleteUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.PlainResultboolean>("/tableInfo/delete", {
    method: "GET",
    params: {
      ...params
    },
    ...(options || {})
  });
}

/** getById GET /tableInfo/getById */
export async function getByIdUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getByIdUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.PlainResultTableInfoVo>("/tableInfo/getById", {
    method: "GET",
    params: {
      ...params
    },
    ...(options || {})
  });
}

/** listDataSource GET /tableInfo/listDataSource */
export async function listDataSourceUsingGET(options?: { [key: string]: any }) {
  return request<API.ListResultDataSourceInfoVo>("/tableInfo/listDataSource", {
    method: "GET",
    ...(options || {})
  });
}

/** listSchemaByDataSource GET /tableInfo/listSchemaByDataSource */
export async function listSchemaByDataSourceUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listSchemaByDataSourceUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.ListResultstring>("/tableInfo/listSchemaByDataSource", {
    method: "GET",
    params: {
      ...params
    },
    ...(options || {})
  });
}

/** listTablesBySchemaName POST /tableInfo/listTablesBySchemaName */
export async function listTablesBySchemaNameUsingPOST(body: API.ListTablesBySchemaNameParam, options?: { [key: string]: any }) {
  return request<API.ListResultSchemaTableInfoVo>("/tableInfo/listTablesBySchemaName", {
    method: "POST",
    headers: {
      "Content-Type": "application/json"
    },
    data: body,
    ...(options || {})
  });
}

/** page POST /tableInfo/page */
export async function pageUsingPOST(body: API.PageRequestTableInfoParam, options?: { [key: string]: any }) {
  return request<API.PageResultTableInfoVo>("/tableInfo/page", {
    method: "POST",
    headers: {
      "Content-Type": "application/json"
    },
    data: body,
    ...(options || {})
  });
}

/** saveOrUpdate POST /tableInfo/saveOrUpdate */
export async function saveOrUpdateUsingPOST(body: API.TableInfoParam, options?: { [key: string]: any }) {
  return request<API.PlainResultboolean>("/tableInfo/saveOrUpdate", {
    method: "POST",
    headers: {
      "Content-Type": "application/json"
    },
    data: body,
    ...(options || {})
  });
}
